<template>
	<view>
		<view class="page" v-if="data.is_show">
		   <comp-common v-bind="{data:data}"></comp-common>
		    <comp-header v-bind="{data:data}"></comp-header>
		    <view class="body after-navber">
		        <view class="header-h">
		            <view style="text-align: center;margin-bottom: 40upx">今日付款金额（元）</view>
		            <view style="text-align: center;font-size: 19pt;font-weight: bold;line-height: 1;margin-bottom: 64upx">
		                    {{data.data1}}
		                </view>
		            <view class="flex flex-row">
		                <view class="flex-grow-1 data-col">
		                    <view>浏览人数</view>
		                    <view>{{data.data2}}</view>
		                </view>
		                <view class="flex-grow-1 data-col">
		                    <view>付款订单数</view>
		                    <view>{{data.data3}}</view>
		                </view>
		                <view class="flex-grow-1 data-col">
		                    <view>付款件数</view>
		                    <view>{{data.data4}}</view>
		                </view>
		            </view>
		        </view>
		        <view class="flex flex-row" style="height: 64upx;background: #fff;color: #ff5003;font-size: 10pt; padding: 0 24upx;margin-bottom: 24upx" v-if="data.data5">
		            <view class="flex-grow-0 flex-y-center">
		                <image src="../../../static/store/notice.png" style="width: 34upx;height: 34upx;margin-right: 20upx"></image>
		            </view>
		            <view class="flex-grow-1 flex-y-center">{{data.data5}}</view>
		        </view>
		        <view class="flex flex-row menu-list" style="margin-bottom: 24upx">
		            <view class="flex-grow-0 menu-item">
		                <form bindsubmit="navigatorSubmit" reportSubmit="true">
		                    <input name="url" style="display: none" value="/store/m/setting/setting"></input>
		                    <button class="block-button" formType="submit">
		                        <image src="../../../static/store/menu-1.png"></image>
		                        <view>店铺管理</view>
		                    </button>
		                </form>
		            </view>
		            <view class="flex-grow-0 menu-item">
		                <form bindsubmit="navigatorSubmit" reportSubmit="true">
		                    <input name="url" style="display: none" value="/store/m/goods/goods"></input>
		                    <button class="block-button" formType="submit">
		                        <image src="../../../static/store/menu-2.png"></image>
		                        <view>商品管理</view>
		                    </button>
		                </form>
		            </view>
		            <view class="flex-grow-0 menu-item">
		                <form bindsubmit="navigatorSubmit" reportSubmit="true">
		                    <input name="url" style="display: none" value="/store/m/order/order"></input>
		                    <button class="block-button" formType="submit">
		                        <image src="../../../static/store/menu-3.png"></image>
		                        <view>订单管理</view>
		                    </button>
		                </form>
		            </view>
		            <view class="flex-grow-0 menu-item">
		                <form bindsubmit="navigatorSubmit" reportSubmit="true">
		                    <input name="url" style="display: none" value="/store/m/tongji/tongji"></input>
		                    <button class="block-button" formType="submit">
		                        <image src="../../../static/store/menu-4.png"></image>
		                        <view>数据统计</view>
		                    </button>
		                </form>
		            </view>
		            <view class="flex-grow-0 menu-item">
		                <form bindsubmit="navigatorSubmit" reportSubmit="true">
		                    <input name="url" style="display: none" value="/store/m/account/account"></input>
		                    <button class="block-button" formType="submit">
		                        <image src="../../../static/store/menu-5.png"></image>
		                        <view>资产</view>
		                    </button>
		                </form>
		            </view>
		            <view class="flex-grow-0 menu-item">
		                <form bindsubmit="navigatorSubmit" reportSubmit="true">
		                    <input name="url" style="display: none" value="/store/m/shop-qrcode/shop-qrcode"></input>
		                    <button class="block-button" formType="submit">
		                        <image src="../../../static/store/menu-6.png"></image>
		                        <view>店铺二维码</view>
		                    </button>
		                </form>
		            </view>
		            <view class="flex-grow-0 menu-item" v-if="false">
		                <form bindsubmit="navigatorSubmit" reportSubmit="true">
		                    <input name="url" style="display: none" value="/pages/store/setting/setting"></input>
		                    <button class="block-button" formType="submit">
		                        <image src="../../../static/store/menu-7.png"></image>
		                        <view>收款码</view>
		                    </button>
		                </form>
		            </view>
		        </view>
		        <view style="text-align: center;margin-bottom: 24upx">
		            <view @click="showPcUrl" style="padding: 24upx;font-size: 9pt;color: #888;display: inline-block">PC端管理网址</view>
		        </view>
		        <view class="pc-url" :class="[data.show_pc_url?'show':'']">
		            <view @click="hidePcUrl" class="modal-bg"></view>
		            <view @click="copyPcUrl" class="modal-dialog">
		                <view style="margin-bottom: 32upx">{{data.pc_url}}</view>
		                <view style="font-size: 9pt;color: #888;text-align: center">点击可复制内容</view>
		            </view>
		        </view>
		    </view>
		    	<comp-footer v-bind="{data:data}"></comp-footer>
		</view>
		
	</view>
</template>

<script>var myVue = {};
	export default {
		data() {
			return {
				data:{
					is_show: !1
				}
			};
		},
		onLoad: function(t) {myVue = this;
		    myVue.getApp.page.onLoad(this, t);
		    var e = this;
		    e.getApp.core.showLoading({
		        title: "加载中"
		    }), e.getApp.request({
		        url: e.getApp.api.store.user.myshop,
		        success: function(t) {
		            e.getApp.core.hideLoading(), 0 == t.code && (0 === t.data.store.is_open && e.getApp.core.showModal({
		                title: "提示",
		                content: "\b店铺已被关闭！请联系管理员",
		                showCancel: !1,
		                success: function(t) {
		                    t.confirm && e.getApp.core.navigateBack();
		                }
		            }), e.setData(t.data), e.setData({
		                is_show: !0
		            })), 1 == t.code && e.getApp.core.redirectTo({
		                url: "/store/apply/apply"
		            });
		        }
		    });
		},
		onReady: function() {
		    myVue.getApp.page.onReady(this);
		},
		onShow: function() {
		    myVue.getApp.page.onShow(this);
		},
		onHide: function() {
		    myVue.getApp.page.onHide(this);
		},
		onUnload: function() {
		    myVue.getApp.page.onUnload(this);
		},
		methods:{
			navigatorSubmit: function(t) {
			    myVue.getApp.request({
			        url: myVue.getApp.api.user.save_form_id + "&form_id=" + t.detail.formId
			    }), myVue.getApp.core.navigateTo({
			        url: t.detail.value.url
			    });
			},
			showPcUrl: function() {
			    this.setData({
			        show_pc_url: !0
			    });
			},
			hidePcUrl: function() {
			    this.setData({
			        show_pc_url: !1
			    });
			},
			copyPcUrl: function() {
			    var e = this;
			    e.getApp.core.setClipboardData({
			        data: e.data.pc_url,
			        success: function(t) {
			            e.showToast({
			                title: "内容已复制"
			            });
			        }
			    });
			}
		}
		
	}
</script>

<style scoped>
.block-button {
    display: block;
    padding: 0;
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    background: none;
    height: 100%;
    border: none;
}

.block-button:after {
    display: none;
}

.header-h {
    background: #26a5ef;
    color: #fff;
    background: -webkit-gradient(linear,0 0,0 bottom,from(#44b9fe),to(#028dde));
    padding: 48upx 0 32upx;
    height: 380upx;
    overflow: hidden;
}

.header-h .data-col {
    text-align: center;
    border-right: 1upx solid rgba(255,255,255,0.35);
}

.header-h .data-col:last-child {
    border-right: none;
}

.menu-list {
    flex-wrap: wrap;
    background: #fff;
    padding: 80upx 0 0;
}

.menu-list .menu-item {
    width: 33.333333%;
    text-align: center;
    font-size: 10pt;
}

.menu-list .menu-item button {
    display: inline-block;
    margin-bottom: 80upx;
}

.menu-list .menu-item image {
    width: 94upx;
    height: 94upx;
    margin-bottom: 6upx;
}

.pc-url {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    padding: 100upx;
    visibility: hidden;
    opacity: .5;
    transition: 200ms;
}

.pc-url.show {
    visibility: visible;
    opacity: 1;
}

.pc-url .modal-bg {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
}

.pc-url .modal-dialog {
    background: #fff;
    padding: 32upx;
    border-radius: 16upx;
    overflow: hidden;
    word-break: break-all;
    position: relative;
}
</style>
